package com.ctshk.rpc.season.mapper;

import com.ctshk.rpc.season.base.CustomBaseMapper;
import com.ctshk.rpc.season.entity.SeasonProductStrategyVaildDate;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * <p>
 * 套票成本策略有效期表 Mapper 接口
 * </p>
 *
 * @author 杨林
 * @since 2021-03-15
 */
public interface SeasonProductStrategyVaildDateMapper extends CustomBaseMapper<SeasonProductStrategyVaildDate> {


    /* @MethodName:根据产品id 获取策率有效日期
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/18 15:57
     **/

    @Select(" select  td.id,td.strategy_id,td.time_begin ,td.time_end from  t_season_product_strategy_vaild_date td" +
            " where td.is_deleted=0 and td.strategy_id in (select id from t_season_product_strategy t " +
            " where t.season_product_id=#{productId}  and t.is_deleted=0)")
    List<SeasonProductStrategyVaildDate> getVaildDateListByProductId(@Param("productId") Long productId);
}
